<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="cmd.css" rel="stylesheet" type="text/css">
<title>外部命令 inifile</title>
</head>

<body>
<p><a href="./GRUB4DOS7外部命令索引.htm">外部命令索引</a><a href="./GRUB4DOS7外部命令索引.htm"></a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-1外部命令chkpci.htm">chkpci</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-2外部命令diskid.htm">diskid</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-3外部命令fat.htm">fat</a> &nbsp;&nbsp;&nbsp;&nbsp;inifile &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-5外部命令menuset.htm">menuset</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-6外部命令unifont.htm">unifont</a> &nbsp;&nbsp;&nbsp;&nbsp;<a href="./GRUB4DOS7-7外部命令wenv.htm">wenv</a></p>
<p>INIFILE FILE &lt;段落名[ /remove]&gt; [var[=STRING]]</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;功能：提取段落内容或去掉段落、提取段落下值</p>
<p>如下面文件oem</p>
<p class="bat">[Defaults]<br>
  scsi=ICH6MAHCI<br>
  [scsi]<br>
  VMSCSI=&quot;VMware SCSI Controller&quot;<br>
  ICH6RAHCI=&quot;INTEL ICH6R AHCI&quot;<br>
  ICH6MAHCI=&quot;INTEL ICH6M AHCI&quot;<br>
  ICH5RRAID=&quot;INTEL ICH5R RAID&quot;<br>
  ICH6RRAID=&quot;INTEL ICH6R RAID&quot;<br>
  ESB1RAID=&quot;INTEL ESB1 RAID&quot;<br>
  ESB2AHCI=&quot;Intel ESB2 AHCI&quot;<br>
  [Files.scsi.VMSCSI]<br>
  driver=vmw,vmscsi.sys,VMSCSI<br>
  inf=vmw,VMSCSI.INF<br>
catalog=vmw,vmscsi.cat</p>
<h4>1：提取段落内容</h4>
<p><span class="cmd">INIFILE /OEM [Defaults]</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;得到scsi=ICH6MAHCI</p>
<h4>2：提取段落下值</h4>
<p><span class="cmd">INIFILE /OEM [Defaults] scsi</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;得到ICH6MAHCI</p>
<h4>3：替换段落下值</h4>
<p><span class="cmd">INIFILE /OEM [Defaults] scsi=ICH6RAHCI</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;scsi=ICH6MAHCI替换为scsi=ICH6RAHCI</p>
<p>注意，替换只能相同长度，不能超过原长度，不然会被截断。</p>
<h4>4：去掉(移除)段落</h4>
<p><span class="cmd">INIFILE /OEM [Defaults] /remove</span></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;目前只是改动[Defaults]为[;efaults]</p>
<p>&nbsp;</p>
<p></p>
</body>
</html>
